<!doctype html>
<%@ page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<html>
<head>
	<meta charset="UTF-8">
	<title>Grima Portal</title>
	<link rel="stylesheet" type="text/css" href="css/themes/bootstrap/easyui.css">
	<link rel="stylesheet" type="text/css" href="css/icon.css">
	<link rel="stylesheet" type="text/css" href="css/portal.css">
	<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
	<link rel="shortcut icon" href="<%=request.getContextPath()%>/img/grima.ico">
	
	
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
</head>

<body class="easyui-layout">

    <div id="header" data-options="region:'north',border:false" style="height:50px;padding:10px;overflow: hidden;">
        <div style="float: left;">
			<a href="<%=request.getContextPath()%>/secure/index.html" style="text-decoration: none;">
				<img src="<%=request.getContextPath()%>/img/logo.png" />
			</a>
        </div>
	</div>

	<div id="login" title="Login">
		<div >

			<c:if test="${param.login_error == 1}">
				<div class="error" style="padding: 5px"> 
					Login/Senha inválidos. Tente novamente.
				</div>				
			</c:if>

		    <form id="ff" action="<c:url value='/loginProcess'/>" method="post">
				<div class="input-group margin-bottom-sm">
				  <span class="input-group-addon"><i class="fa fa-envelope-o fa-fw"></i></span>
				  <input id="j_username" name="j_username" class="form-control" type="text" placeholder="Login" size="30">
				</div>
				<div class="input-group">
				  <span class="input-group-addon"><i class="fa fa-key fa-fw"></i></span>
				  <input id="j_password" name="j_password" class="form-control" type="password" placeholder="Senha" size="30">
				  <input  type="submit" value="Entrar"/> 
				</div>
		    </form>
	    </div>
   	    <div style="float:left;">
	    	<a href="#" style="font-size: 10px;" onclick="forgotPassword();">Esqueci minha senha</a>
   		</div>

<!-- 
	    <div style="float:right;">
	    	<a href="#" class="easyui-linkbutton" onclick="submitForm();">Entrar</a>
	    </div>
 -->
 
 	</div>
 
	<div data-options="region:'south'" style="height:30px;padding:10px;background:#F5F5F5;text-align:center;color:#707070; overflow: hidden;">
	Grima Portal v-1.0.0
	</div>
	
	<script>
		$('#j_username').focus();
		
		function submitForm(){
			$('#ff').form('submit');
		}

		jQuery.fn.center = function () {
		    this.css("position","fixed");
		    this.css("top", ($(window).height() / 2) - (this.outerHeight() / 2));
		    this.css("left", ($(window).width() / 2) - (this.outerWidth() / 2));
		    return this;
		}

		$('#login').center();
		
		$(window).resize(function(){
		   $('#login').center();
		});
		
		function forgotPassword(){
			$.messager.alert('Atenção','A senha foi enviada para o seu e-mail!','info');
		}
	</script>    

</body>

</html>